package com.yt.base.dao.impl;

import java.util.List;

import com.yt.core.dao.GenericDaoImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.yt.base.dao.AclUserOperationDao;
import com.yt.base.model.AclUserOperation;

public class AclUserOperationDaoImpl extends GenericDaoImpl<AclUserOperation, Long> implements AclUserOperationDao {
	
	private final Logger logger = LoggerFactory.getLogger(getClass());
	
	public AclUserOperationDaoImpl() {
		setNameSpace("com.dayima.nose.model.acl_user_operation");
	}
	
	@Override
	public void removeByUser(Long userId) {
		int rowCount = getSqlSession().delete(getNameSpace() + ".delByUid", userId);
		logger.debug("成功清除用户[{}]权限记录{}条", userId, rowCount);
	}
	
	@Override
	public int batchDelete(List<Long> idList) {
		return getSqlSession().delete(getNameSpace() + ".batchDelete", idList);
	}
	
	@Override
	public int batchInsert(List<AclUserOperation> opList) {
		return getSqlSession().insert(getNameSpace() + ".batchInsert", opList);
	}
}
